//-------------------------------------------------------------------
//	Copyright (c) 2010-2014  Zhirnov Andrey
//	This file is part of the "UX Standard Lib" project.
//	See copyright notice in "UX_STL_Core.h".
//-------------------------------------------------------------------

#ifndef _UXS_PAIR_H
#define _UXS_PAIR_H

#pragma once

#include "../BaseTypes/Types.h"

namespace UX_STL
{
namespace UXTypes
{
	
	//
	// Pair
	//

	template <typename T0, typename T1>
	struct TPair
	{
	// types
	public:
		typedef T0				first_t;
		typedef T1				second_t;
		typedef TPair<T0,T1>	Self;


	// variables
	public:
		first_t		first;
		second_t	second;


	// methods
	public:
		TPair () : first(), second() {}

		TPair (const Self &other) : first(other.first), second(other.second) {}

		TPair (const T0 &first, const T1 &second) : first(first), second(second) {}

		RVALUE_REFERENCE_ONLY(
			TPair (Self &&other) : first( ToRValueRef(other) ), second( ToRValueRef(second) ) {}
		
			TPair (T0 &&first, T1 &&second) : first( ToRValueRef(other) ), second( ToRValueRef(second) ) {}
		)

		Self &	operator = (const Self &right)			{ first = right.first;  second = right.second;  return *this; }

		bool	operator == (const Self &right) const	{ return first == right.first and second == right.second; }

		bool	operator != (const Self &right)	const	{ return not (*this == right); }
	};



}	// UX_STL
}	// UXTypes

#endif	// _UXS_PAIR_H